home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / files / for_file < prev    next >
Encoding:
Text File  |  1993-10-26  |  458 b   |  15 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.           for_file var filename { code }
  4.                This procedure implements a loop over the contents of a
  5.                file.   For  each  line in filename, it sets var to the
  6.                line and executes code.
  7.  
  8.                The break and continue commands work as with foreach.
  9.  
  10.                For example, the command
  11.  
  12.                     for_file line /etc/passwd {echo $line}
  13.  
  14.                would echo all the lines in the password file.
  15.